In [6]:
import trimesh
def load_mesh_scene(filename, show_edges=False):
mesh = trimesh.load(filename)
color = [128, 176, 255, 255]
mesh.visual.face_colors = color
geometries = [mesh]
if show_edges:
edges = mesh.face_adjacency_edges
path = trimesh.path.Path3D(**trimesh.path.exchange.misc.edges_to_path(edges, mesh.vertices.copy()))
geometries.append(path)
scene = trimesh.Scene(geometries)
return scene, mesh
In [21]:
scene, mesh = load_mesh_scene("mesh5.stl")
In [22]:
mesh.vertices
Out[22]:
In [23]:
scene.show()
Out[23]: